package cn.xej.miniuiDemo.controller;

import cn.xej.miniuiDemo.common.RespObj;
import cn.xej.miniuiDemo.pojo.User;
import cn.xej.miniuiDemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("/users")
    public RespObj users()
    {
        System.out.println("获取所有用户数据");
        return userService.users();
    }


    @GetMapping("/users1")
    public List<User> users1(){
        System.out.println("users1");
        return userService.users1();
    }

}
